/*
 Navicat Premium Data Transfer

 Source Server         : localMySQL
 Source Server Type    : MySQL
 Source Server Version : 50744 (5.7.44)
 Source Host           : localhost:3306
 Source Schema         : cat-collage

 Target Server Type    : MySQL
 Target Server Version : 50744 (5.7.44)
 File Encoding         : 65001

 Date: 21/01/2024 20:49:30
*/

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for cat_hobbies
-- ----------------------------
DROP TABLE IF EXISTS `cat_hobbies`;
CREATE TABLE `cat_hobbies` (
  `id` varchar(256) NOT NULL COMMENT '唯一主键',
  `cat_id` varchar(256) NOT NULL COMMENT '习性对应的小猫Id',
  `hobby` text NOT NULL COMMENT '习性'
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COMMENT='小猫习性表';

-- ----------------------------
-- Records of cat_hobbies
-- ----------------------------
BEGIN;
INSERT INTO `cat_hobbies` (`id`, `cat_id`, `hobby`) VALUES ('12', '1', '123');
COMMIT;

-- ----------------------------
-- Table structure for cat_images
-- ----------------------------
DROP TABLE IF EXISTS `cat_images`;
CREATE TABLE `cat_images` (
  `id` varchar(256) NOT NULL COMMENT '唯一主键',
  `cat_id` varchar(256) NOT NULL COMMENT '小猫 Id',
  `url` varchar(256) NOT NULL COMMENT '图片链接'
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COMMENT='小猫图片';

-- ----------------------------
-- Records of cat_images
-- ----------------------------
BEGIN;
INSERT INTO `cat_images` (`id`, `cat_id`, `url`) VALUES ('12', '1', '123');
COMMIT;

-- ----------------------------
-- Table structure for cat_positions
-- ----------------------------
DROP TABLE IF EXISTS `cat_positions`;
CREATE TABLE `cat_positions` (
  `id` varchar(256) NOT NULL COMMENT '唯一主键',
  `cat_id` varchar(256) NOT NULL COMMENT '对应的小猫 id',
  `lat` double DEFAULT NULL COMMENT '纬度',
  `lng` double DEFAULT NULL COMMENT '经度',
  `position_description` varchar(256) DEFAULT NULL COMMENT '出现位置信息'
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COMMENT='小猫出现位置';

-- ----------------------------
-- Records of cat_positions
-- ----------------------------
BEGIN;
INSERT INTO `cat_positions` (`id`, `cat_id`, `lat`, `lng`, `position_description`) VALUES ('12', '1', 12, 12, '12');
COMMIT;

-- ----------------------------
-- Table structure for cats
-- ----------------------------
DROP TABLE IF EXISTS `cats`;
CREATE TABLE `cats` (
  `id` varchar(256) NOT NULL COMMENT '唯一Id',
  `name` varchar(256) NOT NULL COMMENT '小猫名字',
  `age` int(11) DEFAULT NULL COMMENT '小猫年龄',
  `weight` int(11) DEFAULT NULL COMMENT '小猫重量（KG）',
  `owner_id` varchar(256) NOT NULL COMMENT '创建者的userId',
  `position_id` int(11) DEFAULT NULL COMMENT '出现位置',
  `image_id` varchar(256) DEFAULT NULL COMMENT '图片Id',
  `hobby_id` varchar(256) DEFAULT NULL COMMENT '小猫习性'
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COMMENT='猫基本信息表';

-- ----------------------------
-- Records of cats
-- ----------------------------
BEGIN;
INSERT INTO `cats` (`id`, `name`, `age`, `weight`, `owner_id`, `position_id`, `image_id`, `hobby_id`) VALUES ('1', '1', 2213, 21, '2', 2, '2', '2');
COMMIT;

-- ----------------------------
-- Table structure for users
-- ----------------------------
DROP TABLE IF EXISTS `users`;
CREATE TABLE `users` (
  `id` varchar(256) NOT NULL COMMENT '用户id',
  `username` varchar(256) NOT NULL COMMENT '用户名称',
  `password` varchar(256) NOT NULL COMMENT '用户密码',
  `token` varchar(255) DEFAULT NULL COMMENT '用户token',
  `avater` varchar(256) DEFAULT NULL COMMENT '头像'
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COMMENT='用户表';

-- ----------------------------
-- Records of users
-- ----------------------------
BEGIN;
INSERT INTO `users` (`id`, `username`, `password`, `token`, `avater`) VALUES ('2', '123123', '123123', NULL, NULL);
COMMIT;

SET FOREIGN_KEY_CHECKS = 1;
